cmake_minimum_required(VERSION 3.10)
project(SDL_Demo)

# 查找 SDL2 库
find_package(SDL2 REQUIRED)

# 添加可执行文件
add_executable(${PROJECT_NAME} main.c)

# 动态链接 SDL2 库
#target_link_libraries(sdl_demo ${SDL2_LIBRARIES})

# 静态链接 SDL2 库
target_link_libraries(${PROJECT_NAME} PRIVATE ${SDL2_STATIC_LIBRARIES})
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -static-libstdc++ -static-libgcc")

# 包含 SDL2 头文件
target_include_directories(${PROJECT_NAME} PRIVATE ${SDL2_INCLUDE_DIRS})